/**   
 * @Title: DeviceInfoCollectCommunicater.java 
 * @Package com.esun.rabbit2.communicaters 
 * @Description: 设备信息收集业务接口
 * @author: Billy Qigs@500wan.com   
 * @date: 2012-7-12 上午9:56:43  
 * Copyright: (C) 2011 Shenzhen E-sun Sky Net Technology Co.,ltd.
 */
package com.esun.rabbit2.communicaters;

import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;

import javax.xml.parsers.ParserConfigurationException;

import org.apache.http.client.ClientProtocolException;
import org.xml.sax.SAXException;

import com.esun.config.BussinessCode;
import com.esun.config.Key;
import com.esun.network.ServerCommunicater;
import com.esun.util.HashMapUtil;

/**
 * @ClassName: DeviceInfoCollectCommunicater
 * @Description: 设备信息收集业务接口
 * @author: Billy Qigs@500wan.com
 * @date: 2012-7-12 上午9:56:43
 * 
 */
public class DeviceInfoCollectCommunicater extends ServerCommunicater {

	public boolean isSendSucceed(String name, String pwd, String channel, String version, String sysversion, String screenreso, String serial, String userimei, String nettype, String location,
			String lat, String lng,String IMEI) throws ClientProtocolException, IOException, ParserConfigurationException, SAXException {

		boolean isSucceed = false;

		ArrayList<HashMap<String, String>> list = new ArrayList<HashMap<String, String>>();

		list.add(HashMapUtil.getMapItem(BussinessCode.PASER_MID, BussinessCode.MID_MACHINE_INFO_COLLECT_COMMUNICATER));
		list.add(HashMapUtil.getMapItem(Key.KEY_USERNAME, name));
		list.add(HashMapUtil.getMapItem(Key.KEY_USERPASS, pwd));
		list.add(HashMapUtil.getMapItem(Key.KEY_CHANNEL, channel));
		list.add(HashMapUtil.getMapItem(Key.KEY_VERSION, version));
		list.add(HashMapUtil.getMapItem(Key.KEY_SYSVERSION, sysversion));
		list.add(HashMapUtil.getMapItem(Key.KEY_SCREENRESO, screenreso));
		list.add(HashMapUtil.getMapItem(Key.KEY_SERIAL, serial));
		list.add(HashMapUtil.getMapItem(Key.KEY_USERIMEI, userimei));
		list.add(HashMapUtil.getMapItem(Key.KEY_NETTYPE, nettype));
		list.add(HashMapUtil.getMapItem(Key.KEY_LOCATION, location));
		list.add(HashMapUtil.getMapItem(Key.KEY_LAT, lat));
		list.add(HashMapUtil.getMapItem(Key.KEY_LNG, lng));
		list.add(HashMapUtil.getMapItem(Key.KEY_MBIMEI, IMEI));

		super.getServerResponse(list, true);

		if (super.getState() == 100) {
			isSucceed = true;
		}

		return isSucceed;

	}

}
